<!--第四课内容 -->
{% extends 'base/layout.html' %}

<!--第四课内容 下面是正文-->
{% block content %}
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ filename }}</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="tabs-container">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a data-toggle="tab"
                                                          href="#tab-0">{{ table_list[0].table_name }}</a>
                                    </li>
                                    {% for j in range(1,table_list|length) %}
                                        <li class=""><a data-toggle="tab"
                                                        href="#tab-{{ j }}">{{ table_list[j].table_name }}</a></li>
                                    {% endfor %}

                                </ul>
                                <div class="tab-content">
                                    <div id="tab-0" class="tab-pane active">
                                        <div class="panel-body">
                                            <div class="table-responsive">
                                                <table class="table table-striped table-bordered table-hover dataTables-example">
                                                    <thead>
                                                    <tr>


                                                        {% for thead in table_list[0].table_sheet_title %}
                                                            <th>{{ thead }}</th>
                                                        {% endfor %}
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    {% for tr_value in table_list[0].table_sheet_values %}
                                                        <tr>
                                                            {% for i in range(tr_value|length) %}
                                                                <td>
                                                                    {{ tr_value[i] }}
                                                                </td>
                                                            {% endfor %}
                                                        </tr>
                                                    {% endfor %}
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    {% for j in range(1,table_list|length) %}
                                        <div id="tab-{{ j }}" class="tab-pane">
                                            <div class="panel-body">
                                                <div class="panel-body">
                                                    <div class="table-responsive">
                                                        <table class="table table-striped table-bordered table-hover dataTables-example">
                                                            <thead>
                                                            <tr>


                                                                {% for thead in table_list[j].table_sheet_title %}
                                                                    <th>{{ thead }}</th>
                                                                {% endfor %}
                                                            </tr>
                                                            </thead>
                                                            <tbody>
                                                            {% for tr_value in table_list[j].table_sheet_values %}
                                                                <tr>
                                                                    {% for i in range(tr_value|length) %}
                                                                        <td>
                                                                            {{ tr_value[i] }}
                                                                        </td>
                                                                    {% endfor %}
                                                                </tr>
                                                            {% endfor %}
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    {% endfor %}
                                </div>


                            </div>


                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script>

        $(document).ready(function () {


            $('.dataTables-example').DataTable({
                language: {
                    "sProcessing": "处理中...",
                    "sLengthMenu": "显示 _MENU_ 项结果",
                    "sZeroRecords": "没有匹配结果",
                    "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                    "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                    "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                    "sInfoPostFix": "",
                    "sSearch": "搜索:",
                    "sUrl": "",
                    "sEmptyTable": "表中数据为空",
                    "sLoadingRecords": "载入中...",
                    "sInfoThousands": ",",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "上页",
                        "sNext": "下页",
                        "sLast": "末页"
                    },
                    "oAria": {
                        "sSortAscending": ": 以升序排列此列",
                        "sSortDescending": ": 以降序排列此列"
                    }
                },
                dom: '<"html5buttons"B>lTfgitp',
                buttons: [
                    {extend: 'copy'},
                    {extend: 'csv'},
                    {extend: 'excel', title: 'ExampleFile'},
                    {extend: 'pdf', title: 'ExampleFile'},

                    {
                        extend: 'print',
                        customize: function (win) {
                            $(win.document.body).addClass('white-bg');
                            $(win.document.body).css('font-size', '10px');

                            $(win.document.body).find('table')
                                .addClass('compact')
                                .css('font-size', 'inherit');
                        }
                    }
                ]
            });
        })


    </script>


{% endblock %}


